@{
    int pageSize = (int)this.ViewData["PageSize"];
    int pageIndex = (int)this.ViewData["PageIndex"];
    int totalPage = (int)this.ViewData["TotalPage"];
    string seoName = (string)this.ViewData["SeoName"];
}
<div class="tr-pagination text-center">
    <ul class="pagination">
        @if (pageIndex > 0 && totalPage > 1)
        {
            <li class="float-left">
                <a class="page-numbers"
                   asp-controller="@ViewContext.RouteData.Values["Controller"]"
                   asp-action="@ViewContext.RouteData.Values["Action"]"
                   asp-route-pageSize="@pageSize"
                   asp-route-pageIndex="@(pageIndex-1)">
                    Previous
                </a>
            </li>
        }
        @for (int i = 0; i < totalPage; i++)
        {
            string cl = i == pageIndex ? "active" : string.Empty;
            <li class="@cl">
                <a class="page-numbers"
                   asp-controller="@ViewContext.RouteData.Values["Controller"]"
                   asp-action="@ViewContext.RouteData.Values["Action"]"
                   asp-route-pageSize="@pageSize"
                   asp-route-pageIndex="@i">
                    @(i + 1)
                </a>
            </li>
        }
        @if (pageIndex < totalPage - 1)
        {
            <li class="float-right">
                <a class="page-numbers"
                   asp-controller="@ViewContext.RouteData.Values["Controller"]"
                   asp-action="@ViewContext.RouteData.Values["Action"]"
                   asp-route-pageSize="@pageSize"
                   asp-route-pageIndex="@(pageIndex+1)">
                    Next
                </a>
            </li>
        }
    </ul>
</div>
